
import { mapServer } from "../server";
/**
 * 删除要素
 * @param {Array} featureIds 要删除的要素ID数组
 * @param {Object} service = {docName: "xzd2404", layerId: 1} 服务信息
 * @param {Object} docLayer 地图图层对象
 */
function delFeature({
                        featureIds,
                        service,
                        docLayer
                    }) {
    var deleteService = new Zondy.Service.EditDocFeature(service.docName, service.layerId, mapServer);
    deleteService.deletes(featureIds, onPntSuccess(docLayer));
}

function onPntSuccess(docLayer){
    return function (result){
        if (result) {
            alert("删除要素成功！");
            docLayer.refresh();
            //获取Select最大索引值，从0开始
        } else {
            alert("删除要素失败！");
        }
    }
}